package com.imooc.demo.springboot.es.controller;

import com.imooc.demo.springboot.es.entity.mysql.MysqlBlog;
import com.imooc.demo.springboot.es.repository.mysql.MysqlRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * Created by hu on 2019/12/21.
 */
@Controller
public class IndexController {

    @Autowired
    MysqlRepository mysqlRepository;

    @RequestMapping("/")
    public String index(){
        List<MysqlBlog> blogList = mysqlRepository.findAll();
        return "index.html";
    }
}
